<?php
/**
 * This is the index.ctp
 * @access public
 * @version 1.0
 */

$userModules =  $userData['Module'];

//echo debug($userData);
$output_str = '';

if(!empty($userModules)){
    foreach($userModules as $module){
        $url_array = explode('/', $module['url']);
        $img = $this->Html->image($module['icon'], array('alt' => $module['name'],'border'=>0));

        $output_str .=  "<li><div class='dash_btn '><div class='icon'> <div class='holder'>".$this->Html->link($img, array('controller' =>  $url_array[0], 'action' => $url_array[1]),array('class'=>'','escape'=>false))."</div></div>";
        $output_str .= "<div class='link'> <div class='holder'>".$this->Html->link(__($module['name'],true), array('controller' =>  $url_array[0], 'action' => $url_array[1]),array('class'=>'','escape'=>false))."</div></div></div></li>";
    }
}
else{
    $output_str ="<li> <div class='dashboard-cell' style=''>". __('You Do Not Have Any Assign Modules.',true)."</div></li>";
}

?>

<!-- Main content -->
<section role="main" id="main">

    <!-- Header -->
    <?php echo $this->element('page_header'); ?>

    <div class="with-padding">
        <div class="columns">
            <div class="new-row-mobile twelve-columns six-columns-tablet twelve-columns-mobile">
                <div class="block large-margin-bottom">
                    <div class="block-title">
                        <h3>Menus</h3>
                        <span class="ribbon"><span class="ribbon-inner">begin</span></span>
                    </div>
                    <div class="with-padding">
                        <ul class="blocks-list dashboard-menus">
                            <?php echo $output_str; ?>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>

</section>
<!-- End main content -->

<!-- Side tabs shortcuts -->
<?php echo $this->element('side_tabs_shortcuts'); ?>
<!-- Sidebar/drop-down menu -->
<?php echo $this->element('right_side_infos'); ?>


<?php
echo $this->Html->script('setup.js');

/** Template functions **/
echo $this->Html->script('developr.input.js');
echo $this->Html->script('developr.message.js');
echo $this->Html->script('developr.modal.js');
echo $this->Html->script('developr.navigable.js');
echo $this->Html->script('developr.notify.js');
echo $this->Html->script('developr.scroll.js');
echo $this->Html->script('developr.progress-slider.js');
echo $this->Html->script('developr.tooltip.js');
echo $this->Html->script('developr.confirm.js');
echo $this->Html->script('developr.agenda.js');
echo $this->Html->script('developr.tabs.js');

echo $this->Html->script('libs/tinycon.min.js');
echo $this->Html->script('custom-scripts/dashboard.js');

// Charts library
// Load the AJAX API
//echo $this->Html->script('google/jsapi.js');
//echo $this->Html->script('custom-scripts/charts.js');
?>